using System;
using System.Collections.Generic;
using AIFSContentManagementSystem.Criteria;
namespace AIFSContentManagementSystem.Articles
{
    public class Article : ModelBase, IParsable, ICriteriaSelectable
	{
        int? articleId;

        public int? ArticleId
        {
            get { return articleId; }
            set { articleId = value; }
        }

        ArticleType articleType;

		public ArticleType ArticleType {
			get 
            {
				return this.articleType;
			}
			set 
            {
				articleType = value;
			}
		}

        List<Criterion> criteria;

        public virtual List<Criterion> Criteria
        {
            get { return criteria; }
            set { criteria = value; }
        }

		DateTime? effectiveFrom;

        public DateTime? EffectiveFrom
        {
            get { return effectiveFrom; }
            set { effectiveFrom = value; }
        }

        DateTime? effectiveThru;

        public DateTime? EffectiveThru
        {
            get { return effectiveThru; }
            set { effectiveThru = value; }
        }

        
        bool? active;

        public bool? Active
        {
            get { return active; }
            set { active = value; }
        }

        string program;

        public string Program
        {
            get { return program; }
            set { program = value; }
        }

		public Article ()
		{
			articleType = ArticleType.UNSET;
			fragments = new List<Fragment>();
			placeHolders = new List<PlaceHolder>();
            criteria = new List<Criterion>();
		}

        List<Fragment> fragments;
        List<PlaceHolder> placeHolders;

        public virtual List<Fragment> Fragments
        {
            get { return fragments; }
            set
            {
                fragments = value;
            }
        }

        public List<PlaceHolder> PlaceHolders
        {
            get
            {
                return this.placeHolders;
            }
            set
            {
                this.placeHolders = value;
            }
        }

        #region IParsable Members
        
        public List<Fragment> GetFragments()
        {
            return Fragments;
        }

        public void SetPlaceHolders(List<PlaceHolder> PlaceHolders)
        {
            this.placeHolders = PlaceHolders;
        }        
        #endregion
    }
}
